/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 80027
 Source Host           : localhost:3306
 Source Schema         : pinky-ponk

 Target Server Type    : MySQL
 Target Server Version : 80027
 File Encoding         : 65001

 Date: 27/08/2022 17:26:59
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu`
(
    `id`                 int NOT NULL AUTO_INCREMENT COMMENT '主键',
    `menu_name`          varchar(16) DEFAULT NULL,
    `menu_icon`          varchar(32) DEFAULT NULL,
    `parent_id`          int         DEFAULT NULL,
    `menu_type`          tinyint     DEFAULT NULL,
    `authority`          varchar(64) DEFAULT NULL,
    `menu_order`         int         DEFAULT NULL,
    `modify_user_id`     bigint      DEFAULT NULL,
    `modify_time`        datetime    DEFAULT NULL,
    `create_user_id`     bigint      DEFAULT NULL,
    `create_user_org_no` varchar(16) DEFAULT NULL,
    `create_time`        datetime    DEFAULT NULL,
    `route_name`         varchar(16) DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 25
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu`
VALUES (1, '顶级', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu`
VALUES (2, '系统管理', 'SettingsFilled', 1, 1, 'sys', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', NULL);
INSERT INTO `sys_menu`
VALUES (3, '菜单管理', 'MenuFilled', 2, 2, 'sys:menu', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', 'Menu');
INSERT INTO `sys_menu`
VALUES (4, '新增', NULL, 3, 3, 'sys:menu:create', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', NULL);
INSERT INTO `sys_menu`
VALUES (5, '删除', NULL, 3, 3, 'sys:menu:delete', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', NULL);
INSERT INTO `sys_menu`
VALUES (6, '修改', NULL, 3, 3, 'sys:menu:modify', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', NULL);
INSERT INTO `sys_menu`
VALUES (7, '列表', NULL, 3, 3, 'sys:menu:list', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', NULL);
INSERT INTO `sys_menu`
VALUES (8, '角色管理', 'SupervisedUserCircleFilled', 2, 2, 'sys:role', 2, 1, '2022-06-03 12:12:44', 1, '01',
        '2022-06-03 12:12:58', 'Role');
INSERT INTO `sys_menu`
VALUES (9, '新增', NULL, 8, 3, 'sys:role:create', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', NULL);
INSERT INTO `sys_menu`
VALUES (10, '删除', NULL, 8, 3, 'sys:role:delete', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', NULL);
INSERT INTO `sys_menu`
VALUES (11, '修改', NULL, 8, 3, 'sys:role:modify', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', NULL);
INSERT INTO `sys_menu`
VALUES (12, '列表', NULL, 8, 3, 'sys:role:list', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', NULL);
INSERT INTO `sys_menu`
VALUES (13, '用户管理', 'PeopleAltFilled', 2, 2, 'sys:user', 3, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58',
        'User');
INSERT INTO `sys_menu`
VALUES (14, '新增', NULL, 13, 3, 'sys:user:create', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', NULL);
INSERT INTO `sys_menu`
VALUES (15, '删除', NULL, 13, 3, 'sys:user:delete', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', NULL);
INSERT INTO `sys_menu`
VALUES (16, '修改', NULL, 13, 3, 'sys:user:modify', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', NULL);
INSERT INTO `sys_menu`
VALUES (17, '列表', NULL, 13, 3, 'sys:user:list', 1, 1, '2022-06-03 12:12:44', 1, '01', '2022-06-03 12:12:58', NULL);
INSERT INTO `sys_menu`
VALUES (24, '组织管理', 'AccountTreeFilled', 2, 2, 'sys:organization', 4, 1, '2022-07-11 15:05:35', 1, '01',
        '2022-07-11 14:53:40', 'Organization');
COMMIT;

-- ----------------------------
-- Table structure for sys_org
-- ----------------------------
DROP TABLE IF EXISTS `sys_org`;
CREATE TABLE `sys_org`
(
    `id`                 int NOT NULL AUTO_INCREMENT,
    `org_no`             varchar(16) DEFAULT NULL,
    `org_name`           varchar(16) DEFAULT NULL,
    `parent_org_no`      varchar(16) DEFAULT NULL,
    `modify_user_id`     bigint      DEFAULT NULL,
    `modify_time`        datetime    DEFAULT NULL,
    `create_user_id`     bigint      DEFAULT NULL,
    `create_user_org_no` varchar(16) DEFAULT NULL,
    `create_time`        datetime    DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `sys_org_org_no_uindex` (`org_no`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 2
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_org
-- ----------------------------
BEGIN;
INSERT INTO `sys_org`
VALUES (1, '01', '顶级', NULL, 1, '2022-06-01 16:29:17', 1, '01', '2022-06-01 16:29:24');
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role`
(
    `id`                 int NOT NULL AUTO_INCREMENT,
    `role_name`          varchar(16) DEFAULT NULL,
    `data_scope`         tinyint     DEFAULT NULL,
    `role_code`          varchar(16) DEFAULT NULL,
    `modify_user_id`     bigint      DEFAULT NULL,
    `modify_time`        datetime    DEFAULT NULL,
    `create_user_id`     bigint      DEFAULT NULL,
    `create_user_org_no` varchar(16) DEFAULT NULL,
    `create_time`        datetime    DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `sys_role_role_code_uindex` (`role_code`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 2
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role`
VALUES (1, '超级管理员', 3, 'SUPER_ADMIN', 1, '2022-06-01 16:30:23', 1, '01', '2022-06-01 16:30:30');
COMMIT;

-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu`
(
    `id`      int NOT NULL AUTO_INCREMENT,
    `role_id` int DEFAULT NULL,
    `menu_id` int DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 18
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_menu`
VALUES (1, 1, 1);
INSERT INTO `sys_role_menu`
VALUES (2, 1, 2);
INSERT INTO `sys_role_menu`
VALUES (3, 1, 3);
INSERT INTO `sys_role_menu`
VALUES (4, 1, 4);
INSERT INTO `sys_role_menu`
VALUES (5, 1, 5);
INSERT INTO `sys_role_menu`
VALUES (6, 1, 6);
INSERT INTO `sys_role_menu`
VALUES (7, 1, 7);
INSERT INTO `sys_role_menu`
VALUES (8, 1, 8);
INSERT INTO `sys_role_menu`
VALUES (9, 1, 9);
INSERT INTO `sys_role_menu`
VALUES (10, 1, 10);
INSERT INTO `sys_role_menu`
VALUES (11, 1, 11);
INSERT INTO `sys_role_menu`
VALUES (12, 1, 12);
INSERT INTO `sys_role_menu`
VALUES (13, 1, 13);
INSERT INTO `sys_role_menu`
VALUES (14, 1, 14);
INSERT INTO `sys_role_menu`
VALUES (15, 1, 15);
INSERT INTO `sys_role_menu`
VALUES (16, 1, 16);
COMMIT;

-- ----------------------------
-- Table structure for sys_role_org
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_org`;
CREATE TABLE `sys_role_org`
(
    `id`      int NOT NULL AUTO_INCREMENT,
    `role_id` int         DEFAULT NULL,
    `org_id`  varchar(16) DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='用户组、角色关联表';

-- ----------------------------
-- Records of sys_role_org
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user`
(
    `id`                 bigint NOT NULL,
    `mobile`             varchar(16)  DEFAULT NULL,
    `email`              varchar(32)  DEFAULT NULL,
    `username`           varchar(16)  DEFAULT NULL,
    `password`           varchar(64)  DEFAULT NULL,
    `nick_name`          varchar(32)  DEFAULT NULL,
    `gander`             tinyint      DEFAULT NULL,
    `avatar`             varchar(128) DEFAULT NULL,
    `org_no`             varchar(16)  DEFAULT NULL,
    `expire_time`        datetime     DEFAULT NULL COMMENT '账号过期时间',
    `status`             tinyint      DEFAULT '1' COMMENT '账户状态:0.Locked 1.Normal',
    `modify_user_id`     bigint       DEFAULT NULL,
    `modify_time`        datetime     DEFAULT NULL,
    `create_user_id`     bigint       DEFAULT NULL,
    `create_user_org_no` varchar(16)  DEFAULT NULL,
    `create_time`        datetime     DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `sys_user_username_uindex` (`username`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user`
VALUES (1, '18855031338', 'liudong.li@foxmail.com', 'admin',
        '$2a$10$QL2fHRopmeRTq4avSic81ueRNy6RP2XBGF3pbhAFZq7WoGhA6s7WK', 'Liudong.li', 1,
        'http://img.520touxiang.com/uploads/allimg/202004111146/jiyu1zar0rd.jpg', '01', '2099-12-31 23:59:59', 1, 1,
        '2022-06-01 16:28:06', 1, '01', '2022-06-01 16:28:21');
COMMIT;

-- ----------------------------
-- Table structure for sys_user_org
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_org`;
CREATE TABLE `sys_user_org`
(
    `id`      int NOT NULL AUTO_INCREMENT,
    `org_id`  bigint DEFAULT NULL,
    `user_id` bigint DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 2
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='用户组、用户关联表';

-- ----------------------------
-- Records of sys_user_org
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_org`
VALUES (1, 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role`
(
    `id`      int NOT NULL AUTO_INCREMENT,
    `user_id` bigint DEFAULT NULL,
    `role_id` int    DEFAULT NULL,
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 2
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role`
VALUES (1, 1, 1);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
